<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <title>
        {% block title %}
        {% if system_config and system_config.site_name %}
        {{ system_config.site_name }}
        {% else %}
        项目管理系统
        {% endif %}
        {% endblock %}
    </title>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">

    <style>
        :root {
            --primary-color: #0d6efd;
            --sidebar-bg: #2c3e50;
            --sidebar-hover: #34495e;
            --sidebar-active: #3498db;
            --content-bg: #f8f9fa;
            --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            --transition-speed: 0.3s;
        }

        body {
            background-color: var(--content-bg);
            padding-top: 56px;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            overflow-x: hidden;
        }

        .sidebar {
            height: calc(100vh - 56px);
            position: fixed;
            top: 56px;
            left: 0;
            width: 250px;
            z-index: 1000;
            background-color: var(--sidebar-bg);
            color: #fff;
            overflow-y: auto;
            transition: all var(--transition-speed) ease;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
            scrollbar-width: thin;
        }

        .sidebar::-webkit-scrollbar {
            width: 5px;
        }

        .sidebar::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 5px;
        }

        .sidebar .nav-link {
            color: rgba(255, 255, 255, .7);
            padding: 0.75rem 1rem;
            border-left: 4px solid transparent;
            transition: all 0.2s ease;
            font-size: 0.95rem;
            position: relative;
            display: flex;
            align-items: center;
        }

        .sidebar .nav-link:hover,
        .sidebar .nav-link.active {
            color: #fff;
            background-color: var(--sidebar-hover);
            border-left: 4px solid var(--sidebar-active);
        }

        .sidebar .submenu {
            padding-left: 0;
            max-height: 0;
            overflow: hidden;
            transition: max-height var(--transition-speed) ease-out;
            background-color: rgba(0, 0, 0, 0.1);
        }

        .sidebar .menu-item.active .submenu {
            max-height: 1000px;
        }

        .sidebar .submenu .nav-link {
            padding-left: 2.5rem;
            font-size: 0.9rem;
            border-left: none;
        }

        .sidebar .submenu .nav-link:hover {
            background-color: rgba(255, 255, 255, 0.05);
        }

        .sidebar .menu-toggle {
            transition: transform var(--transition-speed);
            font-size: 0.8rem;
        }

        .sidebar .menu-item.active .menu-toggle {
            transform: rotate(90deg);
        }

        .main-content {
            margin-left: 250px;
            padding: 20px;
            transition: margin-left var(--transition-speed) ease;
            min-height: calc(100vh - 56px);
            position: relative;
        }

        .main-content.collapsed {
            margin-left: 0;
        }

        .stat-card {
            border-radius: 8px;
            box-shadow: var(--card-shadow);
            border-left: 4px solid var(--primary-color);
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .stat-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
        }

        .table-responsive {
            border-radius: 8px;
            overflow: hidden;
            box-shadow: var(--card-shadow);
        }

        .table th {
            border-top: none;
            background-color: #f8f9fa;
            font-weight: 600;
        }

        .log-item {
            border-left: 3px solid;
            padding-left: 15px;
            margin-bottom: 15px;
            border-radius: 4px;
            background: white;
            padding: 12px 15px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        }

        .log-success {
            border-color: #28a745;
        }

        .log-failed {
            border-color: #dc3545;
        }

        .sidebar.collapsed {
            transform: translateX(-250px);
        }

        .sidebar-header {
            padding: 1rem 1rem 0.5rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            margin-bottom: 0.5rem;
        }

        .menu-category {
            padding: 0.5rem 1rem;
            margin-top: 1rem;
            font-size: 0.8rem;
            color: rgba(255, 255, 255, 0.6);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .menu-toggle-btn {
            position: fixed;
            top: 70px;
            left: 250px;
            z-index: 1001;
            transition: left var(--transition-speed) ease;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            background: var(--sidebar-bg);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .menu-toggle-btn.collapsed {
            left: 0;
        }

        .navbar-brand {
            font-weight: 600;
        }

        .navbar-nav .nav-link {
            transition: color 0.2s;
        }

        .navbar-nav .nav-link:hover {
            color: rgba(255, 255, 255, 0.8);
        }

        /* 修复图标显示问题 */
        .sidebar .nav-link i {
            width: 20px;
            text-align: center;
            margin-right: 10px;
            flex-shrink: 0;
        }

        /* 确保企微图标正确显示 */
        .fa-weixin:before {
            content: "\f1d7";
            font-family: "Font Awesome 6 Brands";
            font-weight: 400;
        }

        /* 移动端遮罩 */
        .sidebar-overlay {
            position: fixed;
            top: 56px;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 999;
            display: none;
        }

        @media (max-width: 991.98px) {
            .sidebar {
                transform: translateX(-250px);
            }

            .sidebar.mobile-show {
                transform: translateX(0);
                box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
            }

            .main-content {
                margin-left: 0;
            }

            .menu-toggle-btn {
                display: none;
            }

            .sidebar-overlay.mobile-show {
                display: block;
            }
        }

        /* 新增样式 */
        .sidebar-header {
            padding: 1rem 1rem 0.5rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            margin-bottom: 0.5rem;
        }

        .nav-item {
            margin-bottom: 0.25rem;
        }

        .badge-notification {
            position: absolute;
            top: 8px;
            right: 8px;
            font-size: 0.6rem;
            padding: 0.2rem 0.4rem;
        }

        .icon-test {
            margin: 20px;
            padding: 20px;
            background: white;
            border-radius: 8px;
            box-shadow: var(--card-shadow);
        }

        /* 菜单项统一图标样式 */
        .menu-icon {
            width: 20px;
            text-align: center;
            margin-right: 10px;
        }
    </style>
</head>
<body>
<!-- 顶部导航栏 -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
    <div class="container-fluid">
        <a class="navbar-brand" href="{{ url_for('admin.dashboard') }}" aria-label="系统首页">
            <i class="fas fa-users-cog me-2"></i>
            {{ system_config.site_name|default('项目管理系统') }}
        </a>
        <button class="navbar-toggler" type="button" id="mobileMenuToggler" aria-label="切换菜单" aria-expanded="false" aria-controls="navbarNav">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav ms-auto">
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true">
                        <i class="fas fa-user me-1"></i> 管理员
                    </a>
                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown" role="menu">
                        <li><a class="dropdown-item" href="{{ url_for('admin.admin_user.change_password') }}"><i class="fas fa-user-cog me-2"></i>修改密码</a></li>
                        <li><a class="dropdown-item" href="{{ url_for('admin.admin_log.operation_logs') }}"><i class="fas fa-bell me-2"></i>通知</a></li>
                        <li><hr class="dropdown-divider"></li>
                        <li><a class="dropdown-item" href="{{ url_for('admin.admin_auth.logout') }}"><i class="fas fa-sign-out-alt me-2"></i>退出登录</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</nav>

<!-- 移动端遮罩 -->
<div class="sidebar-overlay" id="sidebarOverlay"></div>

<!-- Toast提示组件 -->
<div class="position-fixed bottom-0 end-0 p-3" style="z-index: 1100">
    <div id="operationToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
        <div class="toast-header">
            <i id="toastIcon" class="fas fa-info-circle me-2"></i>
            <strong class="me-auto">系统提示</strong>
            <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
        </div>
        <div id="toastBody" class="toast-body"></div>
    </div>
</div>

<!-- 侧边栏菜单切换按钮 -->
<button class="btn btn-sm btn-dark menu-toggle-btn shadow-sm" id="sidebarToggle">
    <i class="fas fa-chevron-left"></i>
</button>

<!-- 侧边栏 -->
<div class="sidebar" id="sidebar">
    <div class="sidebar-header">
        <h5 class="text-center mb-0">导航菜单</h5>
        <small class="d-block text-center text-muted mt-1">v2.1.0</small>
    </div>

    <!-- 核心功能 -->
    <div class="menu-category">核心功能</div>
    <ul class="nav flex-column">
        <li class="nav-item">
            <a class="nav-link" href="{{ url_for('admin.dashboard') }}">
                <i class="fas fa-home menu-icon"></i> 首页
            </a>
        </li>
    </ul>

    <!-- 系统管理 -->
    <div class="menu-category">系统管理</div>
    <ul class="nav flex-column">
        <li class="nav-item menu-item">
            <a class="nav-link d-flex justify-content-between align-items-center" href="#" data-menu="system">
                <div>
                    <i class="fas fa-cogs menu-icon"></i> 系统设置
                </div>
                <i class="fas fa-chevron-right menu-toggle"></i>
            </a>
            <div class="submenu">
                <a class="nav-link" href="{{ url_for('admin.admin_config.system_config') }}">
                    <i class="fas fa-cog menu-icon"></i> 系统配置
                </a>
                <a class="nav-link" href="{{ url_for('admin.admin_user.user_management') }}">
                    <i class="fas fa-users menu-icon"></i> 管理员管理
                </a>
                <a class="nav-link" href="{{ url_for('admin.admin_config.database_config') }}">
                    <i class="fas fa-database menu-icon"></i> 数据库配置
                </a>
                <a class="nav-link optimization-highlight" href="{{ url_for('admin.admin_log.operation_logs') }}">
                    <i class="fas fa-history menu-icon"></i> 操作日志
                </a>
                <a class="nav-link" href="{{ url_for('admin.admin_backup.list_backups') }}">
                    <i class="fas fa-download menu-icon"></i> 备份列表
                </a>
                <a class="nav-link" href="{{ url_for('admin.admin_backup.backup_logs') }}">
                    <i class="fas fa-history menu-icon"></i> 备份日志
                </a>
            </div>
        </li>
    </ul>

    <!-- 组织管理 -->
    <div class="menu-category">组织管理</div>
    <ul class="nav flex-column">

        <li class="nav-item menu-item">
            <a class="nav-link d-flex justify-content-between align-items-center" href="#" data-menu="org">
                <div>
                    <i class="fas fa-sitemap menu-icon"></i> 组织架构
                </div>
                <i class="fas fa-chevron-right menu-toggle"></i>
            </a>
            <div class="submenu">
                <a class="nav-link" href="{{ url_for('admin.admin_department.department_management') }}">
                    <i class="fas fa-sitemap menu-icon"></i> 部门管理
                </a>
                <a class="nav-link" href="{{ url_for('admin.admin_member.member_management') }}">
                    <i class="fas fa-address-card menu-icon"></i> 员工管理
                </a>
            </div>
        </li>
    </ul>

    <!-- 业务功能 -->
    <div class="menu-category">业务功能</div>
    <ul class="nav flex-column">
        <!-- 项目管理 -->
        <li class="nav-item menu-item">
            <a class="nav-link d-flex justify-content-between align-items-center" href="#" data-menu="project">
                <div>
                    <i class="fas fa-project-diagram menu-icon"></i> 项目管理
                </div>
                <i class="fas fa-chevron-right menu-toggle"></i>
            </a>
            <div class="submenu">
                <a class="nav-link" href="{{ url_for('jira.project_list') }}">
                    <i class="fas fa-list menu-icon"></i> 项目列表
                </a>
                <a class="nav-link" href="{{ url_for('jira.create_project') }}">
                    <i class="fas fa-plus-circle menu-icon"></i> 创建项目
                </a>
                <a class="nav-link" href="{{ url_for('jira.task_management') }}">
                    <i class="fas fa-tasks menu-icon"></i> 任务管理
                </a>
                <a class="nav-link" href="{{ url_for('approval.flow_list') }}">
                    <i class="fas fa-project-diagram menu-icon"></i> 审批流程管理
                </a>
                <a class="nav-link" href="{{ url_for('jira.manage_categories') }}">
                    <i class="fas fa-tags menu-icon"></i> 项目类别
                </a>
                <a class="nav-link" href="{{ url_for('jira.manage_levels') }}">
                    <i class="fas fa-layer-group menu-icon"></i> 项目级别
                </a>
                <a class="nav-link" href="{{ url_for('jira.project_stats') }}">
                    <i class="fas fa-chart-pie menu-icon"></i> 项目统计
                </a>
            </div>
        </li>

        <!-- 访客预约-->
        <li class="nav-item menu-item">
            <a class="nav-link d-flex justify-content-between align-items-center" href="#" data-menu="visitor">
                <div>
                    <i class="fas fa-user-friends menu-icon"></i> 访客预约
                </div>
                <i class="fas fa-chevron-right menu-toggle"></i>
            </a>
            <div class="submenu">
                <a class="nav-link" href="#">
                    <i class="fas fa-list menu-icon"></i> 访客列表
                </a>
                <a class="nav-link" href=" ">
                    <i class="fas fa-plus-circle menu-icon"></i> 新增访客
                </a>
                <a class="nav-link" href=" ">
                    <i class="fas fa-calendar-check menu-icon"></i> 预约管理
                </a>
            </div>
        </li>

        <!--消费管理-->
        <li class="nav-item menu-item">
            <a class="nav-link d-flex justify-content-between align-items-center" href="#" data-menu="expense">
                <div>
                    <i class="fas fa-receipt menu-icon"></i> 消费管理
                </div>
                <i class="fas fa-chevron-right menu-toggle"></i>
            </a>
            <div class="submenu">
                <a class="nav-link" href=" ">
                    <i class="fas fa-list menu-icon"></i> 消费记录
                </a>
                <a class="nav-link" href=" ">
                    <i class="fas fa-plus-circle menu-icon"></i> 新增消费
                </a>
                <a class="nav-link" href=" ">
                    <i class="fas fa-chart-line menu-icon"></i> 消费统计
                </a>
            </div>

            <!-- 资产管理 -->
        <li class="nav-item menu-item">
            <a class="nav-link d-flex justify-content-between align-items-center" href="#" data-menu="asset">
                <div>
                    <i class="fas fa-laptop menu-icon"></i> 资产管理
                </div>
                <i class="fas fa-chevron-right menu-toggle"></i>
            </a>
            <div class="submenu">
            <a class="nav-link" href="{{ url_for('asset.asset_list') }}">
                <i class="fas fa-list menu-icon"></i> 资产列表
            </a>
            <a class="nav-link" href="{{ url_for('asset.asset_form') }}">
                <i class="fas fa-plus-circle menu-icon"></i> 新增资产
            </a>
            <a class="nav-link" href="{{ url_for('asset.category_list') }}">
                <i class="fas fa-tags menu-icon"></i> 类别管理
            </a>
                <a class="nav-link" href="{{ url_for('asset.supplier_list') }}">
                    <i class="fas fa-truck menu-icon"></i> 供应商管理
                </a>
            <a class="nav-link" href="{{ url_for('asset.import_assets') }}">
                <i class="fas fa-file-import menu-icon"></i> 批量导入
            </a>


            </div>
        </li>

        <!-- 门禁管理 -->
        <li class="nav-item menu-item">
            <a class="nav-link d-flex justify-content-between align-items-center" href="#" data-menu="access_control">
                <div>
                    <i class="fas fa-door-closed menu-icon"></i> 门禁管理
                </div>
                <i class="fas fa-chevron-right menu-toggle"></i>
            </a>
            <div class="submenu">
                <a class="nav-link" href="{{ url_for('zktime.device_list') }}">
                    <i class="fas fa-list menu-icon"></i> 设备列表
                </a>
                <a class="nav-link" href="{{ url_for('zktime.device_add') }}">
                    <i class="fas fa-plus-circle menu-icon"></i> 添加门禁
                </a>
                <!-- 已移除权限管理菜单 -->
                <a class="nav-link" href="{{ url_for('zktime.access_logs') }}">
                    <i class="fas fa-history menu-icon"></i> 门禁日志
                </a>

            </div>
        </li>
    </ul>

    <!-- 企微管理（独立为一级菜单） -->
    <div class="menu-category">应用集成</div>
    <ul class="nav flex-column">
        <li class="nav-item menu-item">
            <a class="nav-link d-flex justify-content-between align-items-center" href="#" data-menu="wxwork">
                <div>
                    <i class="fab fa-weixin menu-icon"></i> 企微管理
                </div>
                <i class="fas fa-chevron-right menu-toggle"></i>
            </a>
            <div class="submenu">
                <a class="nav-link {% if active_page == 'wxindex' %}active{% endif %}"
                   href="{{ url_for('wxwork.wxindex') }}">
                    <i class="fas fa-tachometer-alt menu-icon"></i> 控制台
                </a>
                <a class="nav-link {% if active_page == 'system_config' %}active{% endif %}"
                   href="{{ url_for('wxwork.system_config') }}">
                    <i class="fas fa-cog menu-icon"></i> 应用设置
                </a>
                <a class="nav-link {% if active_page == 'departments' %}active{% endif %}"
                   href="{{ url_for('wxwork.list_departments') }}">
                    <i class="fas fa-sitemap menu-icon"></i> 组织架构
                </a>
                <a class="nav-link {% if active_page == 'members' %}active{% endif %}" href="{{ url_for('wxwork.list_members') }}">
                    <i class="fas fa-user-friends menu-icon"></i> 人员信息
                </a>
                <a class="nav-link {% if active_page == 'groups' %}active{% endif %}" href="{{ url_for('wxwork.group_management') }}">
                    <i class="fas fa-comments menu-icon"></i> 群组管理
                </a>
                <!-- 新增子菜单项 -->

                <a class="nav-link {% if active_page == 'sync_logs' %}active{% endif %}"
                   href="{{ url_for('wxwork.sync_logs') }}">
                    <i class="fas fa-history menu-icon"></i> 同步日志
                </a>
            </div>
        </li>


        <!-- 海康对接-->
        <li class="nav-item menu-item">
            <a class="nav-link d-flex justify-content-between align-items-center" href="#" data-menu="hikvision_integration">
                <div>
                    <i class="fas fa-video menu-icon"></i> 海康对接
                </div>
                <i class="fas fa-chevron-right menu-toggle"></i>
            </a>
            <div class="submenu">
                <a class="nav-link" href="">
                    <i class="fas fa-list menu-icon"></i> 摄像头列表
                </a>
                <a class="nav-link" href="">
                    <i class="fas fa-plus-circle menu-icon"></i> 添加摄像头
                </a>
                <a class="nav-link" href="">
                    <i class="fas fa-cog menu-icon"></i> 摄像头设置
                </a>
                <a class="nav-link" href="">
                    <i class="fas fa-tools menu-icon"></i> 集成设置
                </a>
                <a class="nav-link" href="">
                    <i class="fas fa-file-alt menu-icon"></i> 集成日志
                </a>
            </div>
        </li>

    </ul>

    <div class="sidebar-footer mt-auto p-3 text-center text-muted">
        <small>© 2023 企业项目管理系统</small>
    </div>
</div>

<!-- 主要内容 -->
<div class="main-content" id="mainContent">
    {% with messages = get_flashed_messages(with_categories=true) %}
    {% if messages %}
    {% for category, message in messages %}
    <div class="alert alert-{{ category }} alert-dismissible fade show" role="alert" style="background: #b5eeac99">
        {{ message }}
        <button aria-label="Close" class="btn-close" data-bs-dismiss="alert" type="button"></button>
    </div>
    {% endfor %}
    {% endif %}
    {% endwith %}

    {% block content %}{% endblock %}
</div>

<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script>
    document.addEventListener('DOMContentLoaded', function() {
        // 菜单项点击展开/折叠
        const menuItems = document.querySelectorAll('.menu-item > .nav-link');
        menuItems.forEach(item => {
            item.addEventListener('click', function(e) {
                e.preventDefault();
                const parent = this.parentElement;

                // 切换当前菜单展开状态
                parent.classList.toggle('active');

                // 关闭其他菜单（可选模式）
                // document.querySelectorAll('.menu-item').forEach(el => {
                //     if(el !== parent) el.classList.remove('active');
                // });
            });
        });

        // 侧边栏折叠/展开按钮
        const sidebarToggle = document.getElementById('sidebarToggle');
        const sidebar = document.getElementById('sidebar');
        const mainContent = document.getElementById('mainContent');
        const sidebarOverlay = document.getElementById('sidebarOverlay');

        sidebarToggle.addEventListener('click', function() {
            sidebar.classList.toggle('collapsed');
            mainContent.classList.toggle('collapsed');
            this.classList.toggle('collapsed');

            // 切换图标方向
            const icon = this.querySelector('i');
            if (sidebar.classList.contains('collapsed')) {
                icon.classList.remove('fa-chevron-left');
                icon.classList.add('fa-chevron-right');
            } else {
                icon.classList.remove('fa-chevron-right');
                icon.classList.add('fa-chevron-left');
            }

            // 保存侧边栏状态到本地存储
            localStorage.setItem('sidebarCollapsed', sidebar.classList.contains('collapsed'));
        });

        // 移动端菜单切换
        const mobileMenuToggler = document.getElementById('mobileMenuToggler');
        mobileMenuToggler.addEventListener('click', function() {
            sidebar.classList.toggle('mobile-show');
            sidebarOverlay.classList.toggle('mobile-show');
        });

        // 点击遮罩层关闭移动端菜单
        sidebarOverlay.addEventListener('click', function() {
            sidebar.classList.remove('mobile-show');
            this.classList.remove('mobile-show');
        });

        // 点击内容区域关闭移动端菜单
        mainContent.addEventListener('click', function() {
            if (window.innerWidth < 992) {
                sidebar.classList.remove('mobile-show');
                sidebarOverlay.classList.remove('mobile-show');
            }
        });

        // 初始化侧边栏状态
        const isSidebarCollapsed = localStorage.getItem('sidebarCollapsed') === 'true';
        if (isSidebarCollapsed) {
            sidebar.classList.add('collapsed');
            mainContent.classList.add('collapsed');
            sidebarToggle.classList.add('collapsed');
            const icon = sidebarToggle.querySelector('i');
            icon.classList.remove('fa-chevron-left');
            icon.classList.add('fa-chevron-right');
        }

        // 自动激活当前页面对应的菜单项
        const currentPath = window.location.pathname;
        document.querySelectorAll('.nav-link').forEach(link => {
            if (link.getAttribute('href') === currentPath) {
                link.classList.add('active');

                // 如果是子菜单项，同时激活父菜单
                const parentMenu = link.closest('.submenu');
                if (parentMenu) {
                    const parentMenuItem = parentMenu.previousElementSibling;
                    if (parentMenuItem) {
                        parentMenuItem.classList.add('active');
                        parentMenu.closest('.menu-item').classList.add('active');
                    }
                }
            }
        });

        // 响应窗口大小变化
        window.addEventListener('resize', function() {
            if (window.innerWidth >= 992) {
                sidebar.classList.remove('mobile-show');
                sidebarOverlay.classList.remove('mobile-show');
            }
        });
    });
</script>
</body>
</html>